#region Header
//=============================================================================
//                          GShield (Game Shield)
//=============================================================================
//
// Original Programmer: Shawn Jackson
// Company: WaveTech Digital Technologies, Inc. (http://www.wtdt.com)
// Copyright: (c) 2006 WaveTech Digital Technologies, Inc. All Rights Reserved.
// Assembly: Library
// Code File Name: Setting.cs
// Code File Date: 01/01/2007
//
// Code File Info: Setting Object Definiation
//=============================================================================
/*
 * UPDATES
 * -------
 *			ShawnJ 8/7/2007 (0.9.5.x): Code Commenting.
 */
#endregion Header

#region License
/*
  GShield - Game Shield
  Copyright (C) 2006-2007 WaveTech Digital Technologies, Inc.
                                http://www.wtdt.com

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
*/
#endregion License

#region Includes
using System.Text;
#endregion Includes

namespace WaveTech.GShield.Library.Objects
{
    /*
  /// <summary>
  /// Class defing a Settings object
  /// </summary>
  public class Setting
	{
		#region Private Members
		private int? m_id;
		private string m_adminPassword;
		private int? m_lpq1Id;
		private string m_lpq1Ans;
		private int? m_lpq2Id;
		private string m_lpq2Ans;
		private string m_adminEmail;
		private string m_smtpServer;
		private bool? m_smtpRequireLogin;
		private string m_smtpLogin;
		private string m_smtpPassword;
		private bool? m_enableOtherProcessWatcher;
  	private bool? m_trimNonExactRatingResults;
		private int? m_ratingsSleepTimer;
		private int? m_bannedSleepTimer;
		private int? m_timeSleepTimer;
		private int? m_usageSleepTimer;
  	private string m_version;
		private string m_hash;
		#endregion Private Members

		#region Public Properties
		/// <summary>
		/// Primary identifier for this object
		/// </summary>
		public int? Id
    {
      get { return m_id; }
      set { m_id = value; }
    }

		/// <summary>
		/// Hashed administration password
		/// </summary>
    public string AdminPassword
    {
      get { return m_adminPassword; }
      set { m_adminPassword = value; }
    }

		/// <summary>
		/// Lost Password Question 1 Id
		/// </summary>
    public int? Lpq1Id
    {
      get { return m_lpq1Id; }
      set { m_lpq1Id = value; }
    }

		/// <summary>
		/// The answer to the first lost password question 
		/// </summary>
    public string Lpq1Ans
    {
      get { return m_lpq1Ans; }
      set { m_lpq1Ans = value; }
    }

		/// <summary>
		/// Lost password question 2 Id
		/// </summary>
    public int? Lpq2Id
    {
      get { return m_lpq2Id; }
      set { m_lpq2Id = value; }
    }

		/// <summary>
		/// The answer to the second lost password question
		/// </summary>
    public string Lpq2Ans
    {
      get { return m_lpq2Ans; }
      set { m_lpq2Ans = value; }
    }

		/// <summary>
		/// The administrator's email address
		/// </summary>
    public string AdminEmail
    {
      get { return m_adminEmail; }
      set { m_adminEmail = value; }
    }

		/// <summary>
		/// The Smtp server used to send email
		/// </summary>
    public string SmtpServer
    {
      get { return m_smtpServer; }
      set { m_smtpServer = value; }
    }

		/// <summary>
		/// Stored hash for this object
		/// </summary>
    public string Hash
    {
      get { return m_hash; }
      set { m_hash = value; }
    }

		/// <summary>
		/// Does the Smtp server require a login?
		/// </summary>
    public bool? SmtpRequireLogin
    {
      get { return m_smtpRequireLogin; }
      set { m_smtpRequireLogin = value; }
    }

		/// <summary>
		/// Login (Username) for the Smtp server
		/// </summary>
    public string SmtpLogin
    {
      get { return m_smtpLogin; }
      set { m_smtpLogin = value; }
    }

		/// <summary>
		/// Password for the Smtp server
		/// </summary>
    public string SmtpPassword
    {
      get { return m_smtpPassword; }
      set { m_smtpPassword = value; }
    }

		/// <summary>
		/// Enables the 'other' process watcher which originally was for games
		/// which did not user DirectX or OpenGL. Now this bit ensures that 
		/// games added manually are detected.
		/// </summary>
    public bool? EnableOtherProcessWatcher
    {
      get { return m_enableOtherProcessWatcher; }
      set { m_enableOtherProcessWatcher = value; }
    }

		/// <summary>
		/// The amount of time, in miliseconds, that the Ratings watcher will
		/// sleep for between checks.
		/// </summary>
    public int? RatingsSleepTimer
    {
      get { return m_ratingsSleepTimer; }
      set { m_ratingsSleepTimer = value; }
    }

		/// <summary>
		/// The amount of time, in miliseconds, that the Banned games watcher will
		/// sleep for between checks.
		/// </summary>
    public int? BannedSleepTimer
    {
      get { return m_bannedSleepTimer; }
      set { m_bannedSleepTimer = value; }
    }

		/// <summary>
		/// The amount of time, in miliseconds, that the Time watcher will
		/// sleep for between checks.
		/// </summary>
    public int? TimeSleepTimer
    {
      get { return m_timeSleepTimer; }
      set { m_timeSleepTimer = value; }
    }

		/// <summary>
		/// The amount of time, in miliseconds, that the Usage watcher will
		/// sleep for between checks.
		/// </summary>
    public int? UsageSleepTimer
    {
      get { return m_usageSleepTimer; }
      set { m_usageSleepTimer = value; }
    }

		/// <summary>
		/// Current version of GShield that is running (i.e. database version)
		/// </summary>
  	public string Version
  	{
  		get { return m_version; }
  		set { m_version = value; }
  	}

		/// <summary>
		/// Tells the system to ignore non exact results returned from the ESRB
		/// ratings query. This allows for games that may have names as parts
		/// of other game names to only return, more correct, results. 
		/// </summary>
  	public bool? TrimNonExactRatingResults
  	{
  		get { return m_trimNonExactRatingResults; }
  		set { m_trimNonExactRatingResults = value; }
  	}

  	#endregion Public Properties
    
    #region Public Functions
		/// <summary>
		/// Sets the Administrator (Management) password. Required to save the
		/// password.
		/// </summary>
		/// <param name="password">Password as a string to set</param>
    public void SetAdminPassword(string password)
    {
      m_adminPassword = Common.Hash.ComputeHash(password, "SHA256", null);
    }

		/// <summary>
		/// Determines if the supplied password matches the one currently
		/// stored.
		/// </summary>
		/// <param name="password">Password to check as a string</param>
		/// <returns>True if the passwords match, otherwise false</returns>
    public bool IsPasswordValid(string password)
    {
      if (m_adminPassword == null || password == null)
        return false;

      return Common.Hash.VerifyHash(password, "SHA256", m_adminPassword);
    }

		/// <summary>
		/// Computes the hash for the critical members of this object
		/// </summary>
		/// <returns>Hash string</returns>
    public string ComputeHash()
    {
      StringBuilder newHash = new StringBuilder();

			if (m_adminPassword != null)
				newHash.Append(m_adminPassword.Trim());

			if (m_adminEmail != null)
				newHash.Append(m_adminEmail.Trim());

			if (m_lpq1Id != null)
				newHash.Append(m_lpq1Id.ToString().Trim());

			if (m_lpq1Ans != null)
				newHash.Append(m_lpq1Ans.ToString().Trim());

			if (m_lpq2Id != null)
				newHash.Append(m_lpq2Id.ToString().Trim());

			if (m_lpq2Ans != null)
				newHash.Append(m_lpq2Ans.Trim());

			if (m_smtpServer != null)
				newHash.Append(m_smtpServer.Trim());

      return Common.Hash.ComputeHash(newHash.ToString(), "SHA256", null);
    }

		/// <summary>
		/// Determines if the current hash of the critical members
		/// match the stored hash
		/// </summary>
		/// <returns>True if the hashs match, otherwise false</returns>
		public bool IsHashValid()
		{
			if (m_hash == null)
				return false;

			return Common.Hash.VerifyHash(ComputeHash(), "SHA256", m_hash);
		}
    #endregion Public Functions
  }
    */
}